package cn.xshi.bpm.service.impl;

import cn.xshi.bpm.service.LcProductService;
import cn.xshi.common.base.BaseService;
import cn.xshi.bpm.dao.LcProductDao;
import cn.xshi.bpm.model.LcProduct;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * @Desc 产品线
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service
public class LcProductServiceImpl extends BaseService implements LcProductService {

    @Resource
    private LcProductDao lcProductDao;

    /**
     *
     * @param condition
     * @return
     */
    public List<LcProduct> getLcProductListByCondition(Map<String,Object> condition){
        return lcProductDao.getLcProductListByCondition(condition);
    }

    /**
     * 查询对象
     * @param id
     * @return
     */
    public LcProduct getLcProductById(String id){
        return lcProductDao.getLcProductById(id);
    }

    /**
     * 添加
     * @param lcProduct
     * @return
     */
    public int addLcProduct(LcProduct lcProduct){
        lcProduct.setCreateTime(getDate());
        lcProduct.setCreateId(getCurrentAccountId());
        lcProduct.setId(toUUID());
        return lcProductDao.addLcProduct(lcProduct);
    }

    /**
     * 修改
     * @param lcProduct
     * @return
     */
    public int updateLcProduct(LcProduct lcProduct){
        lcProduct.setUpdateId(getCurrentAccountId());
        lcProduct.setUpdateTime(getDate());
        return lcProductDao.updateLcProduct(lcProduct);
    }

    /**
     * 删除
     * @param condition
     * @return
     */
    public int delLcProduct(Map<String, Object> condition){
        return lcProductDao.delLcProduct(condition);
    }
}